package lib;

import java.util.*;
import java.io.*;
public class BubbleSort {
	static ArrayList<Double> husbd_sort=new ArrayList<Double>();
	static ArrayList<String> wife_sort=new ArrayList<String>();
	static ArrayList<Integer> index_list=new ArrayList<Integer>();
	public static void sort(ArrayList<Double> husbd, ArrayList<String> wife)
	{
		if(husbd.size()>0)
		{
			
			int remember=0;
			double Max=-10;
			for(int i=0;i<husbd.size();i++)
			{
				
				if(husbd.get(i)>Max)
				{
					Max=husbd.get(i);
					remember=i;
				}
			}
			husbd_sort.add(Max);
			index_list.add(remember);
			wife_sort.add(wife.get(remember));
			husbd.remove(remember);
			wife.remove(remember);
			sort(husbd,wife);
		}
		else
		{
			return; 
		}
		
		
	}
	
	public static void main(String[] args)
	{
		ArrayList<Double> husbd=new ArrayList<Double>();
		ArrayList<String> wife=new ArrayList<String>();
		husbd.add(5.0);
		husbd.add(-5.0);
		husbd.add(-2.0);
		husbd.add(1.0);
		husbd.add(4.0);
		
		wife.add("e");
		wife.add("c");
		wife.add("b");
		wife.add("a");
		wife.add("d");
		
		sort(husbd,wife);
		for(String iter:wife_sort)
		{
			System.out.println(iter);
		}
		
	}

}
